package com.ecoolex.chinadutyfree.retailer.ws;

import java.util.List;

import org.apache.dubbo.config.annotation.Service;
import org.springframework.beans.factory.annotation.Autowired;

import com.ecoolex.chinadutyfree.retailer.core.manager.DirectMailGoodsShoppingCartManager;
import com.ecoolex.chinadutyfree.retailer.entity.DirectMailGoodsShoppingCart;
import com.ecoolex.framework.common.pojo.Page;
import com.ecoolex.framework.common.pojo.Pagination;
import com.ecoolex.framework.common.pojo.Sorting;

@Service
public class DirectMailGoodsShoppingCartServiceImpl implements DirectMailGoodsShoppingCartService{
	
	@Autowired
	private DirectMailGoodsShoppingCartManager maneger;
	
	
	@Override
	public DirectMailGoodsShoppingCart addShoppingCart(Integer directMailProductId, Integer buyNumber, Integer userId,
													   String userName, Boolean isTemporary) {
		return maneger.add(directMailProductId,buyNumber,userId, userName,isTemporary);
	}

	@Override
	public void delShoppingCart(List<Integer> cartIdList,Integer userId, String userName) {
		maneger.del(cartIdList, userId,userName);
	}

	@Override
	public DirectMailGoodsShoppingCart updateShoppingCart(Integer cartId, Integer buyNumber,Integer userId) {
		return maneger.update(cartId, buyNumber,userId);
	}

	@Override
	public Pagination<DirectMailGoodsShoppingCart> queryShoppingCartList(Sorting[] sorts, Page page,Integer userId) {
		return maneger.query(sorts, page,userId);
	}
	
	@Override
	public List<DirectMailGoodsShoppingCart> queryShoppingCartByCartIds(List<Integer> cartIds, Integer userId) {
		return maneger.queryByCartIds(cartIds, userId);
	}

	@Override
	public DirectMailGoodsShoppingCart getShoppingCartById(Integer cartId, Integer userId) {
		return maneger.getShoppingCartById(cartId, userId);
	}
	
	@Override
	public Long countValidTotalNumberByUserId(Integer userId) {
		return maneger.countValidTotalNumberByUserId(userId);
	}

}
